package com.kj.tms.test.entity;

import java.io.Serializable;
import java.util.Date;

/**
 * 用户信息
 *
 * @author yangrd
 *     2019-09-04
 */

public class UserT implements Serializable {
    private Integer id; //主键自增id
    private String userid; //表示userid就是pk,这里这样写比较好理解,除了user表以外其他都用pk
    private String userName; //用户名称
    private String password; //用户密码没有实际用处，由于数据库设计的不能为null,默认为空
    private String description; //描述
    private Date birthday; //生日日期
    private Date registerdate; //注册日期
    private String location; //没有用可以不赋值
    private String company; //公司名称
    private String email; //邮箱
    private String usercode; //用户编码
    private String phone; //手机号码
    private String telnum; //电话号码
    private String avatar; //用户头像信息
    private String association; //角色信息
    private Date ts; //系统日期
    private String deptPk; //部门id
    private String deptName; //部门名称
    private String bankCard; //银行卡号
    private String bankName; //银行名称
    private String openBank; //开户银行
    private Integer dr; //删除标记
    private String postName; //岗位、职务名称
    private String postPk; //岗位、职务pk
    private String rankName; //职级名称
    private String rankPk; //职级pk
    private String deptcode; //部门code
    private String orgpk; //默认组织pk
    private String orgname; //默认组织名称
    private String orgcode; //组织编码
    private boolean isshowswitchorg; //是否显示组织切换
    private String financeOrgId; //财务组织id
    private String financeOrgName; //财务组织名称
    private String financeOrgCode; //财务组织编码
    private String personId; //所关联人员id
    private String personName; //所关联人员名称
    private String tenantId; //tenantId租户id 现在不使用这个id
    private String yhtUserCode; //友互通编码
    private String bankPk; //银行pk
    private String defaultAccount; //默认账号
    private String type; //人员类别 admin管理员，user用户

    /*合并UserQueryConstants类 用于Map的key值 start*/
    public static final String USERNAME = "username";
    public static final String PHONE = "phone";
    public static final String USERCODE = "usercode";
    public static final String ORGPK = "orgpk";
    public static final String ORGNAME = "orgname";
    public static final String DEPTPK = "deptpk";
    public static final String DEPTNAME = "deptname";
    public static final String RANKPK = "rankpk";
    public static final String RANKNAME = "rankname";
    public static final String POSTPK = "postpk";
    public static final String POSTNAME = "postname";
    public static final String REGEX_EMAIL = "^([a-z0-9A-Z]+[-|\\.]?)+[a-z0-9A-Z]@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\\.)+[a-zA-Z]{2,}$";
    /*合并UserQueryConstants类 end*/

    public UserT() {

    }

    public UserT(String userid, String phone) {
        this.userid = userid;
        this.phone = phone;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getUserName() {
        return userName;
    }

    public String getCompany() {
        return company;
    }

    public void setCompany(String company) {
        this.company = company;
    }

    public String getTelnum() {
        return telnum;
    }

    public void setTelnum(String telnum) {
        this.telnum = telnum;
    }

    public String getAvatar() {
        return avatar;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }

    public void setUserName(String userName) {
        this.userName = userName == null ? null : userName.trim();
    }

    @Deprecated
    public String getPassword() {
    	if (this.password == null) {
    		return "";
		}
    	return this.password;
    }

    @Deprecated
    public void setPassword(String password) {
        this.password = password;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description == null ? null : description.trim();
    }

    public Date getBirthday() {
        return birthday;
    }

    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }

    public Date getRegisterdate() {
        return registerdate;
    }

    public void setRegisterdate(Date registerdate) {
        this.registerdate = registerdate;
    }

    public String getLocation() {
        return location;
    }

    public void setLocation(String location) {
        this.location = location == null ? null : location.trim();
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email == null ? null : email.trim();
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone == null ? null : phone.trim();
    }

    public String getUserid() {
        return userid;
    }

    public void setUserid(String userid) {
        this.userid = userid;
    }

    public String getAssociation() {
        return association;
    }

    public void setAssociation(String association) {
        this.association = association;
    }

    public Date getTs() {
        return ts;
    }

    public void setTs(Date ts) {
        this.ts = ts;
    }

    public String getUsercode() {
        return usercode;
    }

    public void setUsercode(String usercode) {
        this.usercode = usercode;
    }

    public String getDeptPk() {
        return deptPk;
    }

    public void setDeptPk(String deptPk) {
        this.deptPk = deptPk;
    }

    public String getDeptName() {
        return deptName;
    }

    public void setDeptName(String deptName) {
        this.deptName = deptName;
    }

    public String getBankCard() {
        return bankCard;
    }

    public void setBankCard(String bankCard) {
        this.bankCard = bankCard;
    }

    public String getBankName() {
        return bankName;
    }

    public void setBankName(String bankName) {
        this.bankName = bankName;
    }

    public String getOpenBank() {
        return openBank;
    }

    public void setOpenBank(String openBank) {
        this.openBank = openBank;
    }

    public Integer getDr() {
        return dr;
    }

    public void setDr(Integer dr) {
        this.dr = dr;
    }

    public String getPostName() {
        return postName;
    }

    public void setPostName(String postName) {
        this.postName = postName;
    }

    public String getRankPk() {
        return rankPk;
    }

    public void setRankPk(String rankPk) {
        this.rankPk = rankPk;
    }

    public String getRankName() {
        return rankName;
    }

    public void setRankName(String rankName) {
        this.rankName = rankName;
    }

    public String getPostPk() {
        return postPk;
    }

    public void setPostPk(String postPk) {
        this.postPk = postPk;
    }

    public String getDeptcode() {
        return deptcode;
    }

    public void setDeptcode(String deptcode) {
        this.deptcode = deptcode;
    }

    public String getOrgpk() {
        return orgpk;
    }

    public void setOrgpk(String orgpk) {
        this.orgpk = orgpk;
    }

    public String getOrgname() {
        return orgname;
    }

    public void setOrgname(String orgname) {
        this.orgname = orgname;
    }

    public boolean isshowswitchorg() {
        return isshowswitchorg;
    }

    public void setIsshowswitchorg(boolean isshowswitchorg) {
        this.isshowswitchorg = isshowswitchorg;
    }

    public String getFinanceOrgId() {
        return financeOrgId;
    }

    public void setFinanceOrgId(String financeOrgId) {
        this.financeOrgId = financeOrgId;
    }

    public String getFinanceOrgName() {
        return financeOrgName;
    }

    public void setFinanceOrgName(String financeOrgName) {
        this.financeOrgName = financeOrgName;
    }

    public String getFinanceOrgCode() {
        return financeOrgCode;
    }

    public void setFinanceOrgCode(String financeOrgCode) {
        this.financeOrgCode = financeOrgCode;
    }

    public String getPersonId() {
        return personId;
    }

    public void setPersonId(String personId) {
        this.personId = personId;
    }

    public String getPersonName() {
        return personName;
    }

    public void setPersonName(String personName) {
        this.personName = personName;
    }

    public String getOrgcode() {
        return orgcode;
    }

    public void setOrgcode(String orgcode) {
        this.orgcode = orgcode;
    }

    public String getYhtUserCode() {
        return yhtUserCode;
    }

    public void setYhtUserCode(String yhtUserCode) {
        this.yhtUserCode = yhtUserCode;
    }

    public String getDefaultAccount() {
        return defaultAccount;
    }

    public void setDefaultAccount(String defaultAccount) {
        this.defaultAccount = defaultAccount;
    }

    public String getBankPk() {
        return bankPk;
    }

    public void setBankPk(String bankPk) {
        this.bankPk = bankPk;
    }

    /**
     * 获取用户的手机号或者邮箱
     *
     * @return
     */
    public String fetchUserPhoneOrEmail() {
        if (this.getPhone() != null && !"".equalsIgnoreCase(this.getPhone())) {
            return this.getPhone();
        }
        return this.getEmail();
    }

    public String getTenantId() {
        return tenantId;
    }

    public void setTenantId(String tenantId) {
        this.tenantId = tenantId;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public UserT clone() {
        UserT user = null;
        try {
            user = (UserT) super.clone();
        } catch (CloneNotSupportedException e) {
            e.printStackTrace();
        }
        return user;
    }

    @Override
    public String toString() {
        return "UserT{" +
                "id=" + id +
                ", userid='" + userid + '\'' +
                ", userName='" + userName + '\'' +
                ", password='" + password + '\'' +
                ", description='" + description + '\'' +
                ", birthday=" + birthday +
                ", registerdate=" + registerdate +
                ", location='" + location + '\'' +
                ", company='" + company + '\'' +
                ", email='" + email + '\'' +
                ", usercode='" + usercode + '\'' +
                ", phone='" + phone + '\'' +
                ", telnum='" + telnum + '\'' +
                ", avatar='" + avatar + '\'' +
                ", association='" + association + '\'' +
                ", ts=" + ts +
                ", deptPk='" + deptPk + '\'' +
                ", deptName='" + deptName + '\'' +
                ", bankCard='" + bankCard + '\'' +
                ", bankName='" + bankName + '\'' +
                ", openBank='" + openBank + '\'' +
                ", dr=" + dr +
                ", postName='" + postName + '\'' +
                ", postPk='" + postPk + '\'' +
                ", rankName='" + rankName + '\'' +
                ", rankPk='" + rankPk + '\'' +
                ", deptcode='" + deptcode + '\'' +
                ", orgpk='" + orgpk + '\'' +
                ", orgname='" + orgname + '\'' +
                ", orgcode='" + orgcode + '\'' +
                ", isshowswitchorg=" + isshowswitchorg +
                ", financeOrgId='" + financeOrgId + '\'' +
                ", financeOrgName='" + financeOrgName + '\'' +
                ", financeOrgCode='" + financeOrgCode + '\'' +
                ", personId='" + personId + '\'' +
                ", personName='" + personName + '\'' +
                ", tenantId='" + tenantId + '\'' +
                ", yhtUserCode='" + yhtUserCode + '\'' +
                '}';
    }
}
